import Vapor
import Fluent

final class SimpleBuilding: Model, Content {
    static let schema: String = "simplebuilding"
    
    @ID
    var id: UUID?
    
    @Field(key: "name")
    var name: String?
    
    @Field(key: "height")
    var height: Double
    
    @Field(key: "length")
    var length: Double
    
    @Field(key: "pitch")
    var pitch: Double
    
    @Field(key: "positionX")
    var positionX: Double
    
    @Field(key: "positionY")
    var positionY: Double
    
    @Field(key: "showFlag")
    var showFlag: Bool
    
    @Field(key: "showTextBalloon")
    var showTextBalloon: Bool
    
    @Field(key: "width")
    var width: Double
    
    @Parent(key: "projectID")
    var project: Project
    
    
    init() {}
    
    init(id: UUID? = nil, name: String, height: Double, length: Double,
         pitch: Double, positionX: Double, positionY: Double, showFlag: Bool,
         showTextBalloon: Bool, width: Double, projectID: Project.IDValue) {
        self.id = id
        self.name = name
        self.height = height
        self.length = length
        self.pitch = pitch
        self.positionX = positionX
        self.positionY = positionY
        self.showFlag = showFlag
        self.showTextBalloon = showTextBalloon
        self.width = width
        self.$project.id = projectID
    }

    
}
